package com.oocl.euc.core.requestform.repository;

import com.oocl.euc.core.builder.RequestRemarkBuilder;
import com.oocl.euc.core.common.ITTestBase;
import com.oocl.euc.core.requestform.model.RequestRemarks;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;


public class RequestRemarksRepositoryIT extends ITTestBase {

    @Autowired
    private RequestRemarksRepository requestRemarksRepository;

    @Autowired
    private RequestRemarkBuilder requestRemarkBuilder;

    @After
    public void tearDown() throws Exception {
        requestRemarksRepository.deleteAll();
    }

    @Test
    public void should_return_created_request_remarks_when_given_request_remarks() throws Exception {
        RequestRemarks r = requestRemarkBuilder.defaultBuilder().withDescription("desc").withRefNo("123").saveToDB();
        Assert.assertTrue(r != null);
        Assert.assertTrue("123".equals(r.getRefNo()));

    }
}